package com.distributeredis.redis_springboot.spring_fast_json.d01_fastjsontest.jsontypetest;

import com.alibaba.fastjson.annotation.JSONField;
import com.alibaba.fastjson.annotation.JSONType;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.util.Date;

@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString
@Accessors(chain = true)
/**
 * 注解的属性： includes要被序列化的字段
 * 注解的属性：orders 要被序列化的字段的顺序
 */
@JSONType(includes = {"userName","userAddress","userBirthday"},
        orders = {"userAddress","userName","userBirthday"})
class UserPeopleJsonType {
    private String userName;
    private Integer userAge;
    private String userAddress;
    @JSONField(format = "YYYY-MM-dd")
    private Date userBirthday;
}

